package org.example.controller;


import org.example.ResultMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("customer")
public class CustomerController {

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("getService1/{name}/{age}")

    public ResultMap<String> getService1(
            @PathVariable("name") String name,
            @PathVariable("age") int age)
    {
        return restTemplate.getForObject("http://eureka-client/provider/service1/"+name+"/"+age,ResultMap.class);
    }



}
